Skip to content

Show uid if usrname is unknown - #82

Merged
jnolan14 merged 2 commits into
freesurfer:masterfrom
jennydaman:fallback-getuser
Oct 27, 2026
Merged

jnolan14 merged 2 commits into
freesurfer:masterfrom
jennydaman:fallback-getuser

Conversation

@jennydaman

Copy link
Copy Markdown

This PR adds faillback behavior which shows the user's UID if their username is unknown.

The code getpass.getuser() can fail when the username is not known. This happens in secure, underprivileged environments e.g. OpenShift.

Jennings Zhang and others added 2 commits July 15, 2026 12:56
Edited to also catch OSError, which will be raised by getuser() in python 3.13+, and always fall back to UID, so this never returns None.
Merged now so it's included in nightly tests, happy to discuss further if this doesn't work in your environment.
@jnolan14
jnolan14 merged commit 23c71e8 into freesurfer:master Oct 27, 2026
@jennydaman
jennydaman deleted the fallback-getuser branch October 28, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants